import java.sql.SQLException;
import java.util.ArrayList;

import BD.ErreurSQL;
import BD.SessionOracle;
import Bean.Profil;
import DAO.ProfilDAO;

/** L'application du TP JDBC
 * @author Romain Agniel
 *
 */

public class Application
{

	/** la méthode main
	 * @param args
	 */
	public static void main(String[] args)
	{
		try
		{
			ArrayList<Profil> list;
			SessionOracle so = new SessionOracle("i10b04b", "i10b04b");
			ProfilDAO proDAO = new ProfilDAO(so.getConnection());
			
			list = proDAO.getListeProfils();
			System.out.println(list.toString());
			proDAO.creerProfil("test ", "pouet", 10, 10, 10, 10, 0.1, 0.2, 0.3, 0.4);
			System.out.println(list.toString());
			list = proDAO.getListProfilsWithProcedure();
			System.out.println(list.toString());
			list = proDAO.searchProfil("test");
			System.out.println(list.toString());
			proDAO.supprimerProfil("test");
			System.out.println(list.toString());
			list = proDAO.searchProfil("test");
			System.out.println(list.toString());
			list = proDAO.getListeWithMetaData();
			System.out.println(list.toString());
			
		}
		
		catch (ErreurSQL e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
